package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiU_article_reply;

//DAO
public interface U_article_replyMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_ARTICLE_REPLY where ID = #{id}")
	public ApiU_article_reply findU_article_replyById(Integer id);

	// 根据id查看
	@Select("SELECT * FROM U_ARTICLE_REPLY where article_id = #{id}")
	public List<ApiU_article_reply> findU_article_replyByListId(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_article_reply")
	public List<ApiU_article_reply> findU_article_replys();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_article_replysByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_ARTICLE_REPLY (ARTICLE_ID, ADD_TIME, REPLY_CONTENT, USER_ID, USER_NAME, TO_UID, TO_UNAME, IS_DELETE, EXT1, EXT2, EXT3, EXT4, EXT5) VALUES (#{article_id}, #{add_time}, #{reply_content}, #{user_id}, #{user_name}, #{to_uid}, #{to_uname}, #{is_delete}, #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_article_reply(ApiU_article_reply u_article_reply);

	// 修改
	@Update("UPDATE U_ARTICLE_REPLY SET ID = #{id}, ARTICLE_ID = #{article_id}, ADD_TIME = #{add_time}, REPLY_CONTENT = #{reply_content}, USER_ID = #{user_id}, USER_NAME = #{user_name}, TO_UID = #{to_uid}, TO_UNAME = #{to_uname}, IS_DELETE = #{is_delete}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3}, EXT4 = #{ext4}, EXT5 = #{ext5}")
	public int updateU_article_reply(ApiU_article_reply u_article_reply);

	// 删除
	@Delete("DELETE FROM U_ARTICLE_REPLY  where ID = #{id}")
	public int deleteU_article_reply(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
